@import '../../styles/var.less';

.k-modal {
  color: var(--kui-color-font);

  .k-modal-wrap {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    overflow: auto;
    outline: 0;
    -webkit-overflow-scrolling: touch;
  }

  .k-modal-mask {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(55, 55, 55, .6);
    height: 100%;
    z-index: 1001;
    overflow: hidden;
  }

  .k-modal-inner {
    position: relative;
    background-color: var(--kui-color-control-10);
    border: 1px solid var(--kui-color-gray-80);
    z-index: 1001;
    outline: 0;
    border-radius: 12px;
    top: 100px;
    overflow: hidden;
    margin: 0 auto;
    box-shadow: 0 0 10px 3px rgba(55, 55, 55, .2);
    width: 480px; // animation: darken .5s ease-in-out;
  }

  .k-modal-content {
    position: relative;
    border: 0;
    background-clip: padding-box;
    height: 100%;
    overflow: hidden;
    padding: 0 20px;

    .k-modal-close {
      position: absolute;
      cursor: pointer;
      font-size: 20px;
      color: var(--kui-color-font);
      width: 20px;
      height: 20px;
      top: 20px;
      right: 20px;
      transition: all .3s ease-in-out;

      .k-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translateY(-50%) translateX(-50%);
      }

      &:hover {
        color: var(--kui-color-danger);
        border-radius: var(--kui-border-radius);
        background-color: var(--kui-color-gray-80);
        // transform: rotate(360deg);
      }
    }

    .k-modal-header {
      // border-bottom: 1px solid var(--kui-color-gray-80);
      padding: 20px 0;
      line-height: 1;
      font-size: 14px;
      user-select: none;

      .k-modal-header-inner {
        width: 90%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 16px;
        font-weight: 600;
        line-height: 1.1;
      }
    }

    .k-modal-body {
      // padding:20px 0;
      margin-bottom: 20px;
      font-size: 14px;
      line-height: 1.5;
      // height: calc(100% - 43px - 45px);
      overflow: auto;
      box-sizing: border-box;
    }

    .k-modal-footer {
      // border-top: 1px solid var(--kui-color-gray-80);
      padding: 0 0 20px 0;
      text-align: right;
      display: inline-block;
      width: 100%;
      box-sizing: border-box;

      .k-btn {
        margin-left: 8px;
      }
    }
  }
}

.k-modal-has-footer {
  .k-modal-content {
    .k-modal-body {
      height: calc(100% - 43px - 45px);
    }
  }
}

.k-modal-draggable {
  .k-modal-header {
    cursor: move;
  }

  .k-modal-inner {
    position: absolute;
  }
}

.k-modal-centered {
  .k-modal-wrap {
    text-align: center;

    &::before {
      display: inline-block;
      width: 0;
      height: 100%;
      vertical-align: middle;
      content: '';
    }
  }

  .k-modal-inner {
    top: 0;
    display: inline-block;
    text-align: left;
    vertical-align: middle;
  }
}

.k-modal-maximized {
  .k-modal-wrap {
    overflow: hidden;
  }

  .k-modal-inner {
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    border-radius: 0;


    .k-modal-footer {
      position: absolute;
      width: 100%;
      bottom: 0;
      left: 0;
      background: var(--kui-color-control-10);
      box-sizing: border-box;
      padding-right: 20px;
    }
  }
}

.k-toast {
  .k-modal-inner {
    width: 416px;
    background: var(--kui-color-control-10);
    border-radius: var(--kui-border-radius);
    padding: 20px;
    border-radius: 12px;
    overflow: hidden;
  }

  .k-toast-header {
    .k-toast-icon {
      font-size: 28px;
      margin-right: 12px;
      float: left;
    }

    .k-toast-title {
      font-size: 16px;
      font-weight: 600;
      overflow: hidden;
      line-height: 1.5;
    }
  }

  .k-toast-content {
    padding-left: 40px;
    padding-top: 8px;
    font-size: 14px;
  }

  .k-toast-footer {
    float: right;
    margin-top: 20px;

    .k-btn {
      margin-left: 8px;
    }
  }
}

.k-toast-success .k-toast-icon {
  color: var(--kui-color-success);
}

.k-toast-error .k-toast-icon {
  color: var(--kui-color-danger);
}

.k-toast-warning .k-toast-icon {
  color: var(--kui-color-warning);
}

.k-toast-info .k-toast-icon {
  color: var(--kui-color-main);
}

.k-toast-confirm .k-toast-icon {
  color: var(--kui-color-warning);
}

@keyframes k-modal-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.k-modal-fade-enter-active {
  animation: k-modal-fade .4s linear;
}

.k-modal-fade-leave-active {
  animation: k-modal-fade .4s linear reverse;
}

@keyframes k-modal-zoom {
  from {
    opacity: 0;
    transform: scale3d(.3, .3, 0)
  }

  to {
    opacity: 1;
  }
}

.k-modal-zoom-enter-active {
  animation: k-modal-zoom .25s cubic-bezier(.78, .14, .15, .86);
}

.k-modal-zoom-leave-active {
  animation: k-modal-zoom .25s cubic-bezier(.78, .14, .15, .86) reverse;
}